package com.threegroup.web.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Document(indexName = "addressBook", shards = 5, replicas = 1, createIndex = true)
public class AddressBookES {
    @Id
    @JsonFormat
    private Long id;

    @Field(type = FieldType.Long)
    @JsonFormat
    private Long userId;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @JsonFormat
    private String consignee;

    @Field(type = FieldType.Integer)
    @JsonFormat
    private Integer gender;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @JsonFormat
    private String phone;

    @Field(type = FieldType.Auto)
    @JsonFormat
    private String provinceCode;

    @Field(type = FieldType.Auto)
    @JsonFormat
    private String provinceName;

    @Field(type = FieldType.Auto)
    @JsonFormat
    private String cityCode;

    @Field(type = FieldType.Auto)
    @JsonFormat
    private String cityName;

    @Field(type = FieldType.Auto)
    @JsonFormat
    private String districtCode;

    @Field(type = FieldType.Auto)
    @JsonFormat
    private String districtName;

    @Field(type = FieldType.Auto)
    @JsonFormat
    private String detail;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @JsonFormat
    private String label;

    @Field(type = FieldType.Integer)
    @JsonFormat
    private Integer isDefault;

    @Field(type = FieldType.Long)
    @JsonFormat
    private Long creator;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Field(type = FieldType.Date_Nanos)
    private Date createDate;

    @Field(type = FieldType.Long)
    @JsonFormat
    private Long updater;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Field(type = FieldType.Date_Nanos)
    private Date updateDate;

    @Field(type = FieldType.Integer)
    @JsonFormat
    private Integer isDeleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee == null ? null : consignee.trim();
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode == null ? null : provinceCode.trim();
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName == null ? null : provinceName.trim();
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode == null ? null : cityCode.trim();
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName == null ? null : cityName.trim();
    }

    public String getDistrictCode() {
        return districtCode;
    }

    public void setDistrictCode(String districtCode) {
        this.districtCode = districtCode == null ? null : districtCode.trim();
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName == null ? null : districtName.trim();
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail == null ? null : detail.trim();
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label == null ? null : label.trim();
    }

    public Integer getIsDefault() {
        return isDefault;
    }

    public void setIsDefault(Integer isDefault) {
        this.isDefault = isDefault;
    }

    public Long getCreator() {
        return creator;
    }

    public void setCreator(Long creator) {
        this.creator = creator;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Long getUpdater() {
        return updater;
    }

    public void setUpdater(Long updater) {
        this.updater = updater;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }
}